package cn.javass.dp.chianofresponsibility.example6;

/**
 * 商品销售管理模块的业务
 */
public class GoodsSaleEbo {


    public boolean sale(String user, String customer, SaleModel saleModel) {
        //处理顺序
        //1权限检查
        //2通用数据库检查（这个也可能在表现层已经做过了
        //3数据逻辑检查
        //4真正的业务处理
        //目前这里只负责  责任链
        SaleSecurityCheck ssc = new SaleSecurityCheck();
        SaleDataCheck sdc = new SaleDataCheck();
        SaleLogicCheck slc = new SaleLogicCheck();
        SaleMgr sd = new SaleMgr();

        ssc.setSuccessor(sdc);
        sdc.setSuccessor(slc);
        slc.setSuccessor(sd);
        return ssc.sale(user, customer, saleModel);
    }
}
